﻿
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Text:wght@400;700&display=swap');

:root {
    --color: #333;
}

body {
    overflow-x: hidden;
    font-family: 'Red Hat Text', sans-serif;
}

@media (max-width: 768px) {
    .carousel .list .item .title,
    .carousel .list .item .topic {
        font-size: 2em;
        font-weight: bold;
        line-height: 1.3em;
    }
}

    .container {
        text-align: center;
        color: var(--color);
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-image: url('../img/botanical garden/botanicalgarden-bg.png');
        background-size: cover;
        background-position: center;
        /*  this is where the magic happens:  */
        background-attachment: fixed;
    }

    h1 {
        font-weight: 700;
        font-size: 3rem;
    }

    p {
        max-width: 52ch;
        line-height: 1.5;
        padding: 1em;
    }
    /*a {
    display: inline-block;
    padding: 1em 3.5em;
    background-color: var(--color);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 0.3em;
    font-weight: 700;
    letter-spacing: .5px;
    font-size: .875rem;
}
*/
    .blank,
    .other {
        width: 100%;
        min-height: 60vh;
        background-image: url(../img/lifeskill/Blank.png);
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        background-color: var(--color);
        position: relative;
    }

        .blank img {
            width: 100%;
            height: auto;
            position: absolute;
            top: 0;
            left: 0;
            display: none; /* hide by default */
            background-attachment: fixed;
        }

    .img {
        width: 90%;
        height: 200px;
        background-color: lightgrey;
        background-size: cover;
        background-position: center;
        margin-top: 20px;
        border-radius: .3em;
        
    }

    .img-first {
        background-image: url(https://images.unsplash.com/photo-1522163182402-834f871fd851?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1606&q=80);
    }

    .img-second {
        background-image: url(https://images.unsplash.com/photo-1628746404106-4d3843b231b3?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NHx8Y2F2aW5nfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=900&q=60);
    }

    .img-third {
        background-image: url(https://images.unsplash.com/photo-1632853073412-782bf0279d65?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80);
    }

    .second {
        flex-direction: row;
        gap: 1.6em;
    }

    .text-center {
        text-align: center;
    }

    .back-to-top {
        width: 5%;
        position: fixed;
        left: 1%;
        z-index: 99;
    }

    .soon {
        overflow: hidden;
        width: 100%;
        overflow-y: hidden;
    }


/* carousel */
.carousel {
    height: 100vh;
    margin-top: -50px;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

    .carousel .list .item {
        width: 100%;
        height: 100%;
        position: absolute;
        inset: 0 0 0 0;
    }

        .carousel .list .item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .carousel .list .item .content {
            position: absolute;
            top: 20%;
            width: 1140px;
            max-width: 80%;
            left: 50%;
            transform: translateX(-50%);
            padding-right: 30%;
            box-sizing: border-box;
            color: #fff;
            text-shadow: 0 5px 10px #0004;
        }

        .carousel .list .item .author {
            font-weight: bold;
            letter-spacing: 10px;
        }

        .carousel .list .item .title,
        .carousel .list .item .topic {
            font-size: 4em;
            font-weight: bold;
            line-height: 1.3em;
        }

        .carousel .list .item .topic {
            color: #EBE845;
        }

        .carousel .list .item .buttons {
            display: grid;
            grid-template-columns: repeat(2, 130px);
            grid-template-rows: 40px;
            gap: 5px;
            margin-top: 20px;
        }

            .carousel .list .item .buttons button {
                border: none;
                background-color: #eee;
                letter-spacing: 3px;
                font-family: Poppins;
                font-weight: 500;
            }

                .carousel .list .item .buttons button:nth-child(2) {
                    background-color: transparent;
                    border: 1px solid #fff;
                    color: #eee;
                }
/* thumbail */
.thumbnail {
    position: absolute;
    bottom: 50px;
    left: 50%;
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 20px;
}

    .thumbnail .item {
        width: 150px;
        height: 220px;
        flex-shrink: 0;
        position: relative;
    }

        .thumbnail .item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 20px;
        }

        .thumbnail .item .content {
            color: #fff;
            position: absolute;
            bottom: 10px;
            left: 10px;
            right: 10px;
        }

            .thumbnail .item .content .title {
                font-weight: 500;
            }

            .thumbnail .item .content .description {
                font-weight: 300;
            }
/* arrows */
.arrows {
    position: absolute;
    top: 80%;
    right: 52%;
    z-index: 100;
    width: 300px;
    max-width: 30%;
    display: flex;
    gap: 10px;
    align-items: center;
}

    .arrows button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: #eee4;
        border: none;
        color: #fff;
        font-family: monospace;
        font-weight: bold;
        transition: .5s;
    }

        .arrows button:hover {
            background-color: #fff;
            color: #000;
        }

/* animation */
.carousel .list .item:nth-child(1) {
    z-index: 1;
}

    /* animation text in first item */

    .carousel .list .item:nth-child(1) .content .author,
    .carousel .list .item:nth-child(1) .content .title,
    .carousel .list .item:nth-child(1) .content .topic,
    .carousel .list .item:nth-child(1) .content .des,
    .carousel .list .item:nth-child(1) .content .buttons {
        transform: translateY(50px);
        filter: blur(20px);
        opacity: 0;
        animation: showContent .5s 1s linear 1 forwards;
    }

@keyframes showContent {
    to {
        transform: translateY(0px);
        filter: blur(0px);
        opacity: 1;
    }
}

.carousel .list .item:nth-child(1) .content .title {
    animation-delay: 1.2s !important;
}

.carousel .list .item:nth-child(1) .content .topic {
    animation-delay: 1.4s !important;
}

.carousel .list .item:nth-child(1) .content .des {
    animation-delay: 1.6s !important;
}

.carousel .list .item:nth-child(1) .content .buttons {
    animation-delay: 1.8s !important;
}
/* create animation when next click */
.carousel.next .list .item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    bottom: 50px;
    left: 50%;
    border-radius: 30px;
    animation: showImage .5s linear 1 forwards;
}

@keyframes showImage {
    to {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.carousel.next .thumbnail .item:nth-last-child(1) {
    overflow: hidden;
    animation: showThumbnail .5s linear 1 forwards;
}

.carousel.prev .list .item img {
    z-index: 100;
}

@keyframes showThumbnail {
    from {
        width: 0;
        opacity: 0;
    }
}

.carousel.next .thumbnail {
    animation: effectNext .5s linear 1 forwards;
}

@keyframes effectNext {
    from {
        transform: translateX(150px);
    }
}

/* running time */

.carousel .time {
    position: absolute;
    z-index: 1000;
    width: 0%;
    height: 3px;
    background-color: #f1683a;
    left: 0;
    top: 0;
}

.carousel.next .time,
.carousel.prev .time {
    animation: runningTime 3s linear 1 forwards;
}

@keyframes runningTime {
    from {
        width: 100%
    }

    to {
        width: 0
    }
}


/* prev click */

.carousel.prev .list .item:nth-child(2) {
    z-index: 2;
}

    .carousel.prev .list .item:nth-child(2) img {
        animation: outFrame 0.5s linear 1 forwards;
        position: absolute;
        bottom: 0;
        left: 0;
    }

@keyframes outFrame {
    to {
        width: 150px;
        height: 220px;
        bottom: 50px;
        left: 50%;
        border-radius: 20px;
    }
}

.carousel.prev .thumbnail .item:nth-child(1) {
    overflow: hidden;
    opacity: 0;
    animation: showThumbnail .5s linear 1 forwards;
}

.carousel.next .arrows button,
.carousel.prev .arrows button {
    pointer-events: none;
}

.carousel.prev .list .item:nth-child(2) .content .author,
.carousel.prev .list .item:nth-child(2) .content .title,
.carousel.prev .list .item:nth-child(2) .content .topic,
.carousel.prev .list .item:nth-child(2) .content .des,
.carousel.prev .list .item:nth-child(2) .content .buttons {
    animation: contentOut 1.5s linear 1 forwards !important;
}

@keyframes contentOut {
    to {
        transform: translateY(-150px);
        filter: blur(20px);
        opacity: 0;
    }
}

@media screen and (max-width: 678px) {
    .carousel .list .item .content {
        padding-right: 0;
    }

        .carousel .list .item .content .title {
            font-size: 30px;
        }
}